Add message parameter to @experimental annotation#19935
Merged
nicolasstucki merged 1 commit intoscala:mainfrom Apr 8, 2024
Merged
Add message parameter to @experimental annotation#19935nicolasstucki merged 1 commit intoscala:mainfrom
@experimental annotation#19935nicolasstucki merged 1 commit intoscala:mainfrom
Conversation
4972375 to
e99f5e5
Compare
Contributor
|
It has been decided to be included in the 3.5.0 release. |
sjrd
requested changes
Apr 3, 2024
| @@ -131,12 +131,7 @@ object Feature: | |||
|
|
|||
| def checkExperimentalFeature(which: String, srcPos: SrcPos, note: => String = "")(using Context) = | |||
Member
There was a problem hiding this comment.
It looks like the note parameter is never used anymore.
Contributor
Author
There was a problem hiding this comment.
It is used here
report.error(experimentalUseSite(which) + note, srcPos)
^^^^
and comes from
// Checking.scala
Feature.checkExperimentalFeature("features", imp.srcPos,
s"\n\nNote: the scope enclosing the import is not considered experimental because it contains the\nnon-experimental $stable")
Comment on lines
+6
to
+7
| import Annotations.Annotation | ||
| import Constants.Constant |
| then | ||
| sym.addAnnotation(Annotation(defn.ExperimentalAnnot, sym.span)) | ||
| if sym.is(Module) then | ||
| sym.companionClass.getAnnotation(defn.ExperimentalAnnot).foreach(sym.addAnnotation) |
Member
There was a problem hiding this comment.
I don't think it is safe to take an annotation tree and put it in two different places in the AST. Consider creating an accurate copy instead.
Contributor
Author
There was a problem hiding this comment.
Added some helper methods in Annotations.ExperimentalAnnotation.
e99f5e5 to
dbdfcff
Compare
sjrd
approved these changes
Apr 5, 2024
Member
|
I have an experimental function added to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Once we bootstrap this addition, we will be able to enhance the messages of
@experimentaldefinitions in the library, the annotations added-experimentaland the ones we plan to add for language features in #19807.